#include "Entity.h"

Entity::Entity(float p_x, float p_y, SDL_Texture *p_tex)
{

    x = p_x;
    y = p_y;
    currentFrame.x = 0;
    currentFrame.y = 0;
    SDL_QueryTexture(p_tex,NULL,NULL,&currentFrame.w,&currentFrame.h);//获取纹理的长度和宽度
    tex = p_tex;
}

float Entity::getX()
{
    return x;
}
float Entity::getY()
{

    return y;
}
int Entity::getWidth()
{
    return currentFrame.w;
}
int Entity::getHight()
{
    return currentFrame.h;
}
void Entity::setX(float X)
{
    x = X;
}
void Entity::setY(float Y)
{
    y=Y;
}
void Entity::setTex(SDL_Texture *p_tex)
{
    tex=p_tex;
}
SDL_Texture *Entity::getTex()
{
    return tex;
}
SDL_Rect Entity::getCurrentFrame()
{
    return currentFrame;
}